<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<title>会员注册</title>
		<style type="text/css">
<!--
.c1 {
	font-size: 13px;
	color: #FFFFFF;
}

.c2 {
	font-size: 13px;
	font-weight: bold;
	color: #FFFFFF;
}
-->
</style>
		<style type="text/css">
<!--
.menufont {
	font-size: 12px;
	color: #333333;
	text-decoration: none;
}
-->
</style>
		<link href="css/c1.css" rel="stylesheet" type="text/css">
		<link href="css/style.css" rel="stylesheet" type="text/css">
	</head>
<script type="text/javascript">
function isEmail() {
	if (document.form.email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;
	else {
		alert("邮箱不合法！！！");
		return false;
	}
}
function isEmpty(obj) {
	if (obj.value.length == 0) {
		alert("带星号的内容不能为空！！！");
		return true;
	}
}
function same() {
	if (document.form.password.value != document.form.repassword.value) {
		alert("两次密码不一致！！！");
		return false;
	}
}
function check() {
	if(isEmpty(form.uname))
		return false;
	if(isEmpty(form.username))
		return false;
	if(isEmpty(form.password))
		return false;
	if(isEmpty(form.repassword))
		return false;
	if(isEmpty(form.mobile))
		return false;
	if(isEmpty(form.phone))
		return false;
	if(isEmpty(form.email))
		return false;
	if(isEmpty(form.company))
		return false;
	if(isEmpty(form.address))
		return false;
	if(same())
		return false;
	if(!isEmail())
		return false;
}
</script>
<script type="text/javascript">
var ajax;
function ajaxFunction()
{
	var xmlHttp;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
  		// Internet Explorer
		try {
	  		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
	     		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	    	} catch (e) {
	     		alert("您的浏览器不支持AJAX！");
	     		return false;
	    	}
		}
	}
	return xmlHttp;
}
	function checkName() {
		var username = document.getElementById("username").value;
		username = username.replace(/(^\s*)|(\s*$)/g,"");
		if(null != username && "" != username) {
	  	var uri = "checkName.action?user.username=";
	  	uri = uri + username;
	  	uri = uri + "&random=" + Math.random();
	  	uri = encodeURI(encodeURI(uri));
	  	ajax = ajaxFunction();
	 	ajax.onreadystatechange = callback;
	 	ajax.open("get",uri,true);
	    ajax.send(null);
    }
}
function callback(){
 	if (4 == ajax.readyState){
    	if (200 == ajax.status){
    		var msg = ajax.responseText;
    		if(null != msg && "" != msg) {
    			document.getElementById("msg").innerText = msg;
    		}
    	}
 	}
	}
</script>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
		<jsp:include page="top.jsp" />
		<table width="1004" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td height="445">
					<table width="963" height="445" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="192" height="445" valign="top">
								<jsp:include page="left.jsp"></jsp:include>
							</td>
							<td valign="top">
								<table width="760" border="0" cellpadding="0" cellspacing="0">
									<tr>
										<td width="804">
											<img src="image/page/nei92.jpg" width="757" height="61">
											<font color="#FF0000" size="12">${ request.info }</font>
										</td>
									</tr>
									<tr>
										<td height="295" valign="top">
											<table width="625" height="286" border="0" cellpadding="0"
												cellspacing="0">
												<tr>
													<td width="418" height="16" valign="top"
														background="image/page/nei92.jpg">
														<img src="image/page/nei92.jpg" width="418" height="10">
													</td>
													<td width="207" rowspan="4" valign="top">
														<img src="image/page/nei93.jpg" width="317" height="246">
													</td>
												</tr>
												<tr>
													<td height="100" background="image/page/nei92.jpg">

														<form name="form" method="post" action="registe.action">
															<table width="390" height="140" border="0"
																cellpadding="0" cellspacing="0">
																<tr>
																	<td width="35">
																		&nbsp;
																	</td>
																	<td width="68" height="20">
																		&nbsp;姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:
																	</td>
																	<td width="176">
																		<input name="user.UName" id="uname"
																			size="20"/>*
																	</td>
																	<td width="117">
																	</td>
																</tr>
																<tr/>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		&nbsp;
																	</td>
																	<td colspan="2">
																		(请务必填写真实姓名，以便工作人员审核)
																	</td>
																</tr>
																<tr>
																	<td width="29">
																		&nbsp;
																	</td>
																	<td width="68" height="20">
																		用&nbsp;&nbsp;户&nbsp;&nbsp;名:
																	</td>
																	<td width="176">
																		<input name="user.username" type="text" id="username" onblur="checkName()"
																			size="20" onfocus="document.getElementById('msg').innerText='';"/>*
																	</td>
																	<td width="117"><span style="color: #f00;font-size: 12;" id="msg"></span>
																	</td>
																</tr>
																<tr/>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		&nbsp;
																	</td>
																	<td colspan="2">
																		(用于登陆的账号)
																	</td>
																</tr>
																<tr>
																	<td>
																		&nbsp;
																	</td>
																	<td height="20">
																		&nbsp;密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:
																	</td>
																	<td>
																		<input name="user.userpass" type="password" id="password" style="width: 155px"/>*
																	</td>
																	<td width="117">
																	</td>
																</tr>
																<tr/>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		&nbsp;
																	</td>
																	<td colspan="2">
																		(请务必牢记)
																	</td>
																</tr>
																<tr>
																	<td>
																		&nbsp;
																	</td>
																	<td height="20">
																		重复密码:
																	</td>
																	<td>
																		<input name="Repassword" type="password" id="repassword" style="width: 155px"/>*
																	</td>
																	<td>
																	</td>
																</tr>
																<tr>
																	<td>
																		&nbsp;
																	</td>
																	<td height="20">
																		联系电话:
																	</td>
																	<td>
																		<input name="user.mobile" type="text" id="mobile" size="20"/>*
																	</td>
																	<td width="117">
																	</td>
																</tr>
																<tr/>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		&nbsp;
																	</td>
																	<td colspan="2">
																		(请务必填写您常用的联系电话，以便工作人员能及时和你沟通)
																	</td>
																</tr>
																<tr>
																<tr>
																	<td>
																		&nbsp;
																	</td>
																	<td height="20">
																		 公司座机：
																	</td>
																	<td>
																		<input name="user.phone" type="text" id="phone" size="20"/>*
																	</td>
																	<td width="117">
																	</td>
																</tr>
																<tr/>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		&nbsp;
																	</td>
																	<td colspan="2">
																		(请务必填写您贵公司的座机电话，以便工作人员能及时和你沟通)
																	</td>
																</tr>
																<tr>
																	<td>
																		&nbsp;
																	</td>
																	<td height="20">
																		电子邮箱:
																	</td>
																	<td>
																		<input name="user.email" id="email" type="text" size="20"/>*
																	</td>
																	<td width="117">
																	</td>
																</tr>
																<tr/>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		&nbsp;
																	</td>
																	<td colspan="2">
																		(请确保填写正确的邮箱，以便工作人员与您联系)
																	</td>
																</tr>
																<tr>
																	<td>
																		&nbsp;
																	</td>
																	<td height="20">
																		公司名称:
																	</td>
																	<td>
																		<input name="user.company" type="text" id="company" 
																			size="20"/>*
																	</td>
																	<td width="117">
																		
																	</td>
																</tr>
																<tr/>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		&nbsp;
																	</td>
																	<td colspan="2">
																		(请务必填写真实信息，以便工作人员审核)
																	</td>
																</tr>
																<tr>
																	<td>
																		&nbsp;
																	</td>
																	<td height="20">
																		公司地址:
																	</td>
																	<td colspan="2">
																		<input name="user.address" id="address" type="text" size="40"/>*
																	</td>
																</tr>
																<tr/>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		&nbsp;
																	</td>
																	<td colspan="2">
																		(请务必填写详细地址，以便货物能够及时送到)
																	</td>
																</tr>
																<tr>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		&nbsp;
																	</td>
																	<td>
																		<input type="submit" value="注册" onclick="return check();"/>
																		<input type="reset" value="重置"/>
																	</td>
																</tr>
															</table>
														</form>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<jsp:include page="bottom.jsp" />
	</body>
</html>
